﻿using System;

namespace ArtMath.Core.Helper
{
    public static class Angle
    {
        public const double RadRound = 2 * Math.PI, DegreeRound = 360, RToD = 180 / Math.PI, DToR = Math.PI / 180, RightAngle = Math.PI * 0.5;
        public static double StandardizeDegree(double degree)
        {
            if (degree >= 0 && degree < DegreeRound)
            {
                return degree;
            }
            degree %= DegreeRound;
            if (degree < 0) degree += DegreeRound;
            return degree;
        }
        public static double StandardizeRad(double rad)
        {
            if (rad >= 0 && rad < RadRound)
            {
                return rad;
            }
            rad %= RadRound;
            if (rad < 0) rad += RadRound;
            return rad;
        }
    }
}